<?php
/*
 * widget-snort.inc
 *
 * part of pfSense (https://www.pfsense.org)
 * Copyright (c) 2016-2023 Rubicon Communications, LLC (Netgate)
 * Copyright (c) 2014 Bill Meeks
 * All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

require_once("config.inc");

//set variables for custom title and link
$snort_alerts_title = "告警";
$snort_alerts_title_link = "snort/snort_alerts.php";

function widget_snort_uninstall() {

	/* Remove the Snort widget from the Dashboard display list */
	$widgets = config_get_path('widgets/sequence', '');
	if (!empty($widgets)) {
		$widgetlist = explode(",", $widgets);
		foreach ($widgetlist as $key => $widget) {
			if (strstr($widget, "snort_alerts"))
				unset($widgetlist[$key]);
		}
		config_set_path('widgets/sequence', implode(",", $widgetlist));
		write_config("Snort widget removed");
	}
}
?>
